package com.fileCenter.pojo;

public enum FileType {
	
	JPG("jpg"),
	PNG("png"),
	TXT("txt"),
	DOC("doc"),
	XLS("xls"),
	PPT("ppt"),
	PDF("pdf");

	String name;

	FileType(String name) {
		this.name = name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public static FileType getFileTypeByName(String name) {
		for (FileType fileType : FileType.values()) {
			if (fileType.getName().equalsIgnoreCase(name)) {
				return fileType;
			}
		}
		return TXT;
	}

	public String getName() {
		return name;
	}
}
